<!--  -->
<template>
  <view class="main">
    <view class="top"></view>
    <view class="list">
        <view v-for="(it,index) in list"  :key="index" class="item"  :style="{'--i':index+1 ,'background-image':'url('+it.bg+')'}">
            <view class="line"></view>
            <view class="text">{{it.text}}</view>
        </view>
       
         
    </view>
  </view>
</template>

<script>
export default {
  name: "home",
  setup(props) {
    console.log(33);
    return {
      list: [
        {
          text: "索引列表",
          bg: require("../../../static/plg2.jpg")
        },
        {
          text: "微动画",
          bg: require("../../../static/plg1.jpg")
        },
        {
          text: "全屏抽屉",
          bg: require("../../../static/plg3.jpg")
        },
        {
          text: "垂直导航",
          bg: require("../../../static/plg4.jpg")
        }
      ]
    };
  }
};
</script>
<style lang='scss' scoped>
@function px2rem($px, $base-font-size: 75px) {
  @if (unitless($px)) {
    @warn "Assuming #{$px} to be in pixels, attempting to convert it into pixels for you";
    @return px2rem($px + 0px); // That may fail.
  } @else if (unit($px) == rem) {
    @return $px;
  }
  @return ($px / $base-font-size) * 1rem;
}
.main {
  min-height: 100vh;
  width: 100vw;
}
.top {
  height: 1.2rem;
  width: inherit;
  background-image: url("../../../static/cjkz.png"),
    url("../../../static/pluginBg.jpg");
  background-position: center center, center center;
  background-size: 26%, cover;
  background-repeat: no-repeat, no-repeat;
  position: fixed;
  background-color: black;
  top: 0;
  z-index:100;
}
.list {
  margin-top: 1rem;
  display: grid;
  grid-template-rows: 1fr;
  justify-items: center;
  grid-row-gap: 0.266667rem;
  padding: px2rem(40px);
  margin-bottom: px2rem(100px);
  .item {
    position: relative;
    width: 100%;
    height:250px; 
    border-radius: 10px;
    background-repeat: no-repeat;
    background-size: cover;
    // animation-name: fade;
    // animation-duration: .5s;
    // animation-delay: calc(var(--i) * 0.1s);
    // animation-timing-function: ease-in-out;
    // animation-fill-mode: both;
    &::before {
      position: absolute;
      content: "";
      background: inherit;
      top: 5px;
      left: 5px;
      width:inherit;
    height:inherit;
      filter: blur(8px);
      border-radius: inherit;
      z-index:-1;
    //   animation:inherit;
    // animation-duration: .2s;
    }
   
    .line {
      position: absolute;
      top: px2rem(60px);
      left: px2rem(60px);
      width: px2rem(70px);
      height: px2rem(5px);
      background-color: white;
    }
    .text {
      position: absolute;
      top: px2rem(90px);
      left: px2rem(60px);
      font-style: italic;
      font-size: 36px;
      color: rgba(255, 255, 255, 0.6);
    }
  }
}
@keyframes abc {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0);
  }
}
</style>